{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商品管理
    <span class="c-gray en">&gt;</span> 商品列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="/good/goods" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form  method="get" action="">

    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
          <span class="l">
            <a href="javascript:;" onclick="layopen('新增配置','{:url('goods_edit')}',800,600)" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i>新增商品</a>
        </span>

    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="11">商品列表</th>
        </tr>
        <tr class="text-c">
            <th width="40">标识</th>
            <th width="80">商品名字</th>
            <th width="80">价格区间</th>
            <th width="50">开奖时间</th>
            <th width="120">合约收益</th>
            <th width="120">mt收益</th>
            <th width="50">未中奖赠送</th>
            <th width="100">换购类型</th>
            <th width="300">统计</th>
            <th width="50">状态</th>
            <th width="80">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $v}
        <tr class="text-c">
            <td>{$v.id}</td>
            <td>{$v.name}</td>
            <td>{$v.min}-{$v.max}</td>
            <td>{$v.lottery_time}</td>
            <td>{$v.days}*{$v.day_profit}/天={$v.days*$v.day_profit}</td>
            <td>{$v.days}*{$v.mt}/天={$v.days*$v.mt}</td>
            <td>{$v.loss_mt}MT</td>
            <td>
                {switch name="$v.exchange"}
                {case value="1"}合约换购(汇率{$v.exchange_mt}MT){/case}
                {case value="2"}奖金换购(汇率{$v.exchange_mt}MT){/case}
                {default /}不能换购
                {/switch}</td>
            <td>今日预定<font color="orange">{$v.bo_num}</font> 中奖 <font color="orange">{$v.win_num}</font>
                今日待卖:<font color="red">{$v.sell_num}</font>（其中
                换购:<font color="red">{$v.ex_num}</font>
                放单:<font color="red">{$v.sys_num}</font>
                到期:<font color="red">{$v.out_num}</font>
                ）</td>
            <td> {if $v.flag == 1}
                已启用
                {else /} 已禁用
                {/if}</td>
            <td>
                <span class="btn btn-link" title="编辑" href="javascript:;" onclick="layopen('编辑','{:url('goods_edit',['id'=>$v.id])}')">编辑</span>
                <span class="btn btn-link" title="放单" href="javascript:;" onclick="layopen('放单','{:url('sys_open_order',['id'=>$v.id])}')">放单</span>
                </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>

{include file="public/footer" /}
<script type="text/javascript">
    function feed_config(){
        var info = '确认要同步吗？';
        layer.confirm(info,function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('feed_config_redis')}",
                dataType: 'json',
                success: function(data){
                    window.location.href="/system/config";
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){

                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }


</script>
